import { EntityBase } from 'ibiz-core';
import { ISaleplatform } from '../interface';

/**
 * 销售平台基类
 *
 * @export
 * @abstract
 * @class SaleplatformBase
 * @extends {EntityBase}
 * @implements {ISaleplatform}
 */
export abstract class SaleplatformBase extends EntityBase implements ISaleplatform {
    /**
     * 实体名称
     *
     * @readonly
     * @type {string}
     * @memberof SaleplatformBase
     */
    get srfdename(): string {
        return 'SALEPLATFORM';
    }
    get srfkey() {
        return this.saleplatformid;
    }
    set srfkey(val: any) {
        this.saleplatformid = val;
    }
    get srfmajortext() {
        return this.saleplatformname;
    }
    set srfmajortext(val: any) {
        this.saleplatformname = val;
    }
    /**
     * 销售平台名称
     */
    saleplatformname?: any;
    /**
     * 销售平台标识
     */
    saleplatformid?: any;
    /**
     * 建立人
     */
    createman?: any;
    /**
     * 更新时间
     */
    updatedate?: any;
    /**
     * 更新人
     */
    updateman?: any;
    /**
     * 建立时间
     */
    createdate?: any;

    /**
     * 重置实体数据
     *
     * @private
     * @param {*} [data={}]
     * @memberof SaleplatformBase
     */
    reset(data: any = {}): void {
        super.reset(data);
        this.saleplatformid = data.saleplatformid || data.srfkey;
        this.saleplatformname = data.saleplatformname || data.srfmajortext;
    }
}
